package com.byt.common;

import com.byt.base.utils.GsonUtils;
import com.byt.common.bean.PersonalInfo;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

public class Constants {
    //是否第一次安装
    public static final String ADDRESS_CASHE_XMXB = "ADDRESS_CASHE_XMXB";
    public static final String PERSON_CASH_XDOCTOR = "PERSON_CASH_XDOCTOR";
    public static final String ACTION_XMXB_SERVICE_UPLOAD_ALL = "XMXB_SERVICE_UPLOAD_ALL";
    public static final String LESSON_SHOW_GUID = "LESSON_SHOW_GUID";

    public static String LOG_TIME = "LOG_TIME";
    public static final String VOICE_ID = "VOICE_ID";

    public static final String EXPERTS_ID = "user_id";    // 保存的UId
    public static final String EXPERTS_NAME = "experts_name";    // 保存的UId
    public static final String COMPLETE = "COMPLETE";    // 是否完成


    public static final String EVENT_TYPE_GROWTH = "dgd"; // 生长记录
    public static final String EVENT_TYPE_EVENT = "da"; // 大事记
    public static final String EVENT_TYPE_DIARY = "dj"; //日志
    public static final String EVENT_TYPE_EMPTY = "empty"; //空数据


    public static final String VIDEO = "videos/";
    public static final String AUDIOS = "audios/";
    public static final String IMAGE = "images/";
    public static final String APP_UNREADCOUNT = "UnREADCOUNT";


    public static final String PUSH_BRODCAST = "push_brodcast"; // 推送的广播

    public static final String FETAL_MOVE_COUNT = "fetal_move_count"; // 有效数
    public static final String FETAL_CLICK_COUNT = "fetal_click_count"; // 点击数
    public static final String FETAL_CLICK_LAST_TIME = "fetal_click_last_time"; // 上次点击的时间
    public static final String FETAL_CLICK_START_TIME = "fetal_click_start_time"; // 上次开始的时间
    public static final String EXPECTANT_UPDATE_DATA = "expectant_update_data"; // 是否操作过
    public static final String EXPECTANT_UPDATE_SHOW = "expectant_update_show"; // 是否展示过
    public static final String SERVICE_PHONE = "400-888-2805";


    public static PersonalInfo getPersonalInfo() {
        PersonalInfo mPersonalInfo = null;
        try {
            mPersonalInfo = GsonUtils.fromLocalJson(new JSONObject(Constants.PERSON_CASH_XDOCTOR).getString("data"), new TypeToken<PersonalInfo>() {
            }.getType());
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return mPersonalInfo;
    }
}